$('.s_quit').click(function(){
	var path = getRootPath();
	$.post(
			path+"/api/login/exit",
			{},
			function(data){
				if(data.error_code == "0"){
					showDialog("已退出");
					setTimeout('window.location.href="http://cecook.cn/"',1000);
				}
			},
			"json");
});
function showDialog(title){
	var path = getRootPath();
	$('#dialog_title').html('<img src="'+path+'/bm/images/s_tick.png"/>'+title+''); 
	$('.s_popup_delect2,.s_consum').show().delay(2000).fadeOut();
}
function getRootPath() {  
    var pathName = window.location.pathname.substring(1);  
    var webName = pathName == '' ? '' : pathName.substring(0, pathName.indexOf('/'));  
    return window.location.protocol + '//' + window.location.host + '/' + webName + '/';  
}  
function checkloginaccount(code){
	var path = getRootPath();
	if(code == "20028"){
		showDialog(" 账户已被登陆，请重新登陆。");
		setTimeout('window.location.href="'+path+'"',2000);
	}
}
$(document).on('click','.yingxiao',function(){
	var path = getRootPath();
	if(auths.indexOf("bm_activity_menu") > 0){
		window.location.href= path+"api/bm/ui/activityHome";
	}elsesss
	if(auths.indexOf("bm_model_menu") > 0){
		window.location.href= path+"api/bm/ui/model";
	}else
	if(auths.indexOf("bm_smart_mark_menu") > 0){
		window.location.href= path+"api/bm/ui/marketList";
	}else
	if(auths.indexOf("bm_write_off_menu") > 0){
		window.location.href= path+"api/bm/ui/write_off";
	}
});